<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>


<form class="dggui-form" action="" id="remarkFrom" style="width: 93%;">
    <input type="hidden" name="productId" value="${productOrder.id}"/>
    <div class="dggui-form-item">
        <label class="dggui-form-label" style="width: auto;margin-left: 5px;margin-top: 13px;"><span style="font-weight: bold">客户：</span>${productOrder.customerName} ${productOrder.customerPhone}</label>
    </div>
    <div class="dggui-form-item">
        <%--<div class="dggui-input-block">
            <textarea name="remarkInfo" placeholder="请输入备注内容" class="dggui-textarea"></textarea>
        </div>--%>
            <textarea name="remarkInfo" placeholder="请填写备注,1-500字" maxlength="500" class="dggui-textarea" style="margin-left: 20px;"></textarea>
    </div>
</form>
<script>
    function remarkUpdate(index,obj){
        var productId = $('[name="productId"]').val();
        var remarkInfo = $('[name="remarkInfo"]').val().trim();
        if (remarkInfo == ''){
            dggui.dialog.errors('备注内容不能为空！');
            return;
        }
        if(remarkInfo.length > 500){
            dggui.dialog.errors('备注内容长度不能超过500个字！');
            return;
        }
        //var params = $('#remarkFrom').serializeArray();
        dggui.dialog.loading();
        $.ajax({
            type: 'POST',
            url: sysInfo.basePath + '/all_order/remark_order.do',
            data: {'id':productId,'remark':remarkInfo},
            dataType: 'JSON',
            success:function(data){
                dggui.dialog.loading('close');
                if (data.code == 0) {
                    layer.close(index);
                    dggui.dialog.succeed('操作成功！');
                    //刷新列表
                    //search($('#flowNode'));
                    reloadTable(obj,"reloadFalse");
                } else {
                    dggui.dialog.errors(data.msg);
                }
            },
            error: function () {
                dggui.dialog.loading('close');
                dggui.dialog.errors('保存失败，请联系管理员！！');
            }
        });
    }
</script>
